﻿using System;
using System.Web.Services;
using Monkey.Warrenty.Biz;
using Monkey.Warrenty.EntityModel;

namespace MonkeyWarranty.Web.Errors
{
    public partial class List : System.Web.UI.Page
    {
        #region Properties

        private static ErrorBiz _errorBiz;
        private static ErrorBiz ErrorManager
        {
            get { return _errorBiz ?? (_errorBiz = new ErrorBiz()); }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object ErrorList()
        {
            return ErrorManager.GetAllErrorsWs();
        }

        [WebMethod(EnableSession = true)]
        public static object CreateError(Error record)
        {
            return ErrorManager.CreateErrorWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object UpdateError(Error record)
        {
            return ErrorManager.UpdateErrorWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object DeleteError(int Id)
        {
            return ErrorManager.DeleteErrorWs(Id);
            //return null;
        }
    }
}